package com.lcj.aoch.rule.controller.form;

import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Schema(description = "计算订单分账的表单")
public class CalculateProfitsharingForm {
  @NotNull(message = "orderId不能为空")
  @Min(value = 1L, message = "orderId不能小于1")
  @Schema(description = "订单ID")
  private Long orderId;
  
  @NotBlank(message = "amount不能为空")
  @Pattern(regexp = "^[1-9]\\d*\\.\\d{1,2}$|^0\\.\\d{1,2}$|^[1-9]\\d*$", message = "amount内容不正确")
  @Schema(description = "待分账费用")
  private String amount;
  
  public void setOrderId(Long orderId) {
    this.orderId = orderId;
  }
  
  public void setAmount(String amount) {
    this.amount = amount;
  }
  
  public CalculateProfitsharingForm(Long orderId, String amount) {
    this.orderId = orderId;
    this.amount = amount;
  }
  
  public CalculateProfitsharingForm() {}
  
  public String toString() {
    return "CalculateProfitsharingForm(orderId=" + getOrderId() + ", amount=" + getAmount() + ")";
  }
  
  public boolean equals(Object o) {
    if (o == this)
      return true; 
    if (!(o instanceof CalculateProfitsharingForm))
      return false; 
    CalculateProfitsharingForm other = (CalculateProfitsharingForm)o;
    if (!other.canEqual(this))
      return false; 
    Object this$orderId = getOrderId(), other$orderId = other.getOrderId();
    if ((this$orderId == null) ? (other$orderId != null) : !this$orderId.equals(other$orderId))
      return false; 
    Object this$amount = getAmount(), other$amount = other.getAmount();
    return !((this$amount == null) ? (other$amount != null) : !this$amount.equals(other$amount));
  }
  
  protected boolean canEqual(Object other) {
    return other instanceof CalculateProfitsharingForm;
  }
  
  public int hashCode() {
    int PRIME = 59;
    int result = 1;
    Object $orderId = getOrderId();
    result = result * 59 + (($orderId == null) ? 43 : $orderId.hashCode());
    Object $amount = getAmount();
    return result * 59 + (($amount == null) ? 43 : $amount.hashCode());
  }
  
  public Long getOrderId() {
    return this.orderId;
  }
  
  public String getAmount() {
    return this.amount;
  }
}
